import React, { Component } from 'react';
import Bottom from '../bottom/Bottom';
import Xiao from '../xiao/Xiao';
import './Search.css'
class Search extends Component {
    constructor(props) {
        super(props)
        /* console.log(this.props.searchlist);
        console.log(this.props.songs); */
        this.state = {
            value:null,
            searchlist:null,
            songs:null
        }
    }
    componentWillReceiveProps(nextProps) {
        this.setState({
            value:nextProps.value,
            searchlist:nextProps.searchlist,
            songs:nextProps.songs
        });
    }
    render() {
        return (
            <div className='hotBig'>
                {this.state.value ? <Bottom song={this.state.songs} searchlist={this.state.searchlist}></Bottom> : <Xiao msg={this.parentMethod}></Xiao>}
            </div>
        );
    }
}

export default Search;

